var t, e;

module.exports = (t = {}, e = function(e, i) {
    if (!t[e]) return require(i);
    if (!t[e].status) {
        var n = t[e].m;
        n._exports = n._tempexports;
        var r = Object.getOwnPropertyDescriptor(n, "exports");
        r && r.configurable && Object.defineProperty(n, "exports", {
            set: function(t) {
                "object" == typeof t && t !== n._exports && (n._exports.__proto__ = t.__proto__, 
                Object.keys(t).forEach(function(e) {
                    n._exports[e] = t[e];
                })), n._tempexports = t;
            },
            get: function() {
                return n._tempexports;
            }
        }), t[e].status = 1, t[e].func(t[e].req, n, n.exports);
    }
    return t[e].m.exports;
}, function(e, i, n) {
    t[e] = {
        status: 0,
        func: i,
        req: n,
        m: {
            exports: {},
            _tempexports: {}
        }
    };
}(1684372290546, function(t, e, i) {
    Object.defineProperty(i, "__esModule", {
        value: !0
    });
    var n = function(t, e) {
        return (n = Object.setPrototypeOf || {
            __proto__: []
        } instanceof Array && function(t, e) {
            t.__proto__ = e;
        } || function(t, e) {
            for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
        })(t, e);
    };
    function r(t, e) {
        if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
        function i() {
            this.constructor = t;
        }
        n(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, 
        new i());
    }
    var o = function() {
        return (o = Object.assign || function(t) {
            for (var e, i = 1, n = arguments.length; i < n; i++) for (var r in e = arguments[i]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
            return t;
        }).apply(this, arguments);
    };
    function s(t, e, i, n) {
        return new (i || (i = Promise))(function(r, o) {
            function s(t) {
                try {
                    h(n.next(t));
                } catch (t) {
                    o(t);
                }
            }
            function a(t) {
                try {
                    h(n.throw(t));
                } catch (t) {
                    o(t);
                }
            }
            function h(t) {
                var e;
                t.done ? r(t.value) : (e = t.value, e instanceof i ? e : new i(function(t) {
                    t(e);
                })).then(s, a);
            }
            h((n = n.apply(t, e || [])).next());
        });
    }
    function a(t, e) {
        var i, n, r, o, s = {
            label: 0,
            sent: function() {
                if (1 & r[0]) throw r[1];
                return r[1];
            },
            trys: [],
            ops: []
        };
        return o = {
            next: a(0),
            throw: a(1),
            return: a(2)
        }, "function" == typeof Symbol && (o[Symbol.iterator] = function() {
            return this;
        }), o;
        function a(o) {
            return function(a) {
                return function(o) {
                    if (i) throw new TypeError("Generator is already executing.");
                    for (;s; ) try {
                        if (i = 1, n && (r = 2 & o[0] ? n.return : o[0] ? n.throw || ((r = n.return) && r.call(n), 
                        0) : n.next) && !(r = r.call(n, o[1])).done) return r;
                        switch (n = 0, r && (o = [ 2 & o[0], r.value ]), o[0]) {
                          case 0:
                          case 1:
                            r = o;
                            break;

                          case 4:
                            return s.label++, {
                                value: o[1],
                                done: !1
                            };

                          case 5:
                            s.label++, n = o[1], o = [ 0 ];
                            continue;

                          case 7:
                            o = s.ops.pop(), s.trys.pop();
                            continue;

                          default:
                            if (!((r = (r = s.trys).length > 0 && r[r.length - 1]) || 6 !== o[0] && 2 !== o[0])) {
                                s = 0;
                                continue;
                            }
                            if (3 === o[0] && (!r || o[1] > r[0] && o[1] < r[3])) {
                                s.label = o[1];
                                break;
                            }
                            if (6 === o[0] && s.label < r[1]) {
                                s.label = r[1], r = o;
                                break;
                            }
                            if (r && s.label < r[2]) {
                                s.label = r[2], s.ops.push(o);
                                break;
                            }
                            r[2] && s.ops.pop(), s.trys.pop();
                            continue;
                        }
                        o = e.call(t, s);
                    } catch (t) {
                        o = [ 6, t ], n = 0;
                    } finally {
                        i = r = 0;
                    }
                    if (5 & o[0]) throw o[1];
                    return {
                        value: o[0] ? o[1] : void 0,
                        done: !0
                    };
                }([ o, a ]);
            };
        }
    }
    function h(t, e) {
        for (var i = 0, n = e.length, r = t.length; i < n; i++, r++) t[r] = e[i];
        return t;
    }
    Array.prototype.includes || Object.defineProperty(Array.prototype, "includes", {
        value: function(t, e) {
            if (null == this) throw new TypeError('"this" is null or not defined');
            var i = Object(this), n = i.length >>> 0;
            if (0 === n) return !1;
            for (var r, o, s = 0 | e, a = Math.max(s >= 0 ? s : n - Math.abs(s), 0); a < n; ) {
                if ((r = i[a]) === (o = t) || "number" == typeof r && "number" == typeof o && isNaN(r) && isNaN(o)) return !0;
                a++;
            }
            return !1;
        }
    }), String.prototype.includes || (String.prototype.includes = function(t, e) {
        return "number" != typeof e && (e = 0), !(e + t.length > this.length) && -1 !== this.indexOf(t, e);
    }), Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
        value: function(t) {
            if (null == this) throw new TypeError('"this" is null or not defined');
            var e = Object(this), i = e.length >>> 0;
            if ("function" != typeof t) throw new TypeError("predicate must be a function");
            for (var n = arguments[1], r = 0; r < i; ) {
                var o = e[r];
                if (t.call(n, o, r, e)) return o;
                r++;
            }
        }
    });
    var c = function(t) {
        for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
        return e.some(function(e) {
            return Object.prototype.toString.call(t).slice(8, -1).toLowerCase() === e;
        });
    }, l = function(t, e) {
        return Object.prototype.hasOwnProperty.call(t, e);
    }, u = function(t) {
        return [].filter.call(t, function(t) {
            return "\n" !== t;
        }).join("");
    }, f = function(t) {
        return "string" == typeof t && "transparent" !== (t = t.toLocaleLowerCase().trim()) && (!/^rgba/.test(t) || 0 !== (null === (e = /([^\s,]+)\)$/.exec(t)) ? 0 : "object" == typeof e ? NaN : "number" == typeof e ? e : "string" == typeof e ? "%" === e[e.length - 1] ? Number(e.slice(0, -1)) / 100 : Number(e) : NaN));
        var e;
    }, d = function(t, e) {
        var i, n = (null === (i = t.padding) || void 0 === i ? void 0 : i.split(" ").map(function(t) {
            return e(t);
        })) || [ 0 ], r = 0, o = 0, s = 0, a = 0;
        switch (n.length) {
          case 1:
            r = o = s = a = n[0];
            break;

          case 2:
            r = o = n[0], s = a = n[1];
            break;

          case 3:
            r = n[0], s = a = n[1], o = n[2];
            break;

          default:
            r = n[0], o = n[1], s = n[2], a = n[3];
        }
        var h = {
            paddingTop: r,
            paddingBottom: o,
            paddingLeft: s,
            paddingRight: a
        };
        for (var u in h) h[u] = l(t, u) && c(t[u], "string", "number") ? e(t[u]) : h[u];
        return [ r, o, s, a ];
    }, p = function(t) {
        var e = [], i = t.map(function(t) {
            return Number(t);
        }).reduce(function(t, i) {
            if (i > 0) {
                var n = t + i;
                return e.push(n), n;
            }
            return e.push(NaN), t;
        }, 0), n = Math.random() * i;
        return e.findIndex(function(t) {
            return n <= t;
        });
    }, g = function(t, e, i, n) {
        void 0 === n && (n = 1 / 0), n <= 0 && (n = 1 / 0);
        for (var r = "", o = [], s = t.measureText("...").width, a = 0; a < e.length; a++) {
            r += e[a];
            var h = t.measureText(r).width, c = i(o);
            if (n === o.length + 1 && (h += s), c < 0) return o;
            if (h > c && (o.push(r.slice(0, -1)), r = e[a]), n === o.length) return o[o.length - 1] += "...", 
            o;
        }
        return r && o.push(r), o.length || o.push(e), o;
    }, v = function() {
        function t() {
            this.subs = [];
        }
        return t.prototype.addSub = function(t) {
            this.subs.includes(t) || this.subs.push(t);
        }, t.prototype.notify = function() {
            this.subs.forEach(function(t) {
                t.update();
            });
        }, t;
    }(), m = "__proto__" in {};
    function w(t, e, i, n) {
        Object.defineProperty(t, e, {
            value: i,
            enumerable: !!n,
            writable: !0,
            configurable: !0
        });
    }
    var y = Array.prototype, b = Object.create(y);
    [ "push", "pop", "shift", "unshift", "sort", "splice", "reverse" ].forEach(function(t) {
        b[t] = function() {
            for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i];
            var n = y[t].apply(this, e), r = this.__luckyOb__;
            return [ "push", "unshift", "splice" ].includes(t) && r.walk(this), r.dep.notify(), 
            n;
        };
    });
    var S = function() {
        function t(t) {
            this.dep = new v(), w(t, "__luckyOb__", this), Array.isArray(t) && (m ? t.__proto__ = b : Object.getOwnPropertyNames(b).forEach(function(e) {
                w(t, e, b[e]);
            })), this.walk(t);
        }
        return t.prototype.walk = function(t) {
            Object.keys(t).forEach(function(e) {
                z(t, e, t[e]);
            });
        }, t;
    }();
    function C(t) {
        if (t && "object" == typeof t) return "__luckyOb__" in t ? t.__luckyOb__ : new S(t);
    }
    function z(t, e, i) {
        var n = new v(), r = Object.getOwnPropertyDescriptor(t, e);
        if (!r || !1 !== r.configurable) {
            var o = r && r.get, s = r && r.set;
            o && !s || 2 !== arguments.length || (i = t[e]);
            var a = C(i);
            Object.defineProperty(t, e, {
                get: function() {
                    var e = o ? o.call(t) : i;
                    return v.target && (n.addSub(v.target), a && a.dep.addSub(v.target)), e;
                },
                set: function(e) {
                    e !== i && (i = e, o && !s || (s ? s.call(t, e) : i = e, a = C(e), n.notify()));
                }
            });
        }
    }
    var x = 0, k = function() {
        function t(t, e, i, n) {
            void 0 === n && (n = {}), this.id = x++, this.$lucky = t, this.expr = e, this.deep = !!n.deep, 
            this.getter = "function" == typeof e ? e : function(t) {
                t += ".";
                for (var e = [], i = "", n = 0; n < t.length; n++) {
                    var r = t[n];
                    if (/\[|\./.test(r)) e.push(i), i = ""; else {
                        if (/\W/.test(r)) continue;
                        i += r;
                    }
                }
                return function(t) {
                    return e.reduce(function(t, e) {
                        return t[e];
                    }, t);
                };
            }(e), this.cb = i, this.value = this.get();
        }
        return t.prototype.get = function() {
            v.target = this;
            var t = this.getter.call(this.$lucky, this.$lucky);
            return this.deep && function(t) {
                var e = function(t) {
                    c(t, "array", "object") && Object.keys(t).forEach(function(i) {
                        var n = t[i];
                        e(n);
                    });
                };
                e(t);
            }(t), v.target = null, t;
        }, t.prototype.update = function() {
            var t = this.get(), e = this.value;
            this.value = t, this.cb.call(this.$lucky, t, e);
        }, t;
    }(), I = function() {
        function t(t, e) {
            var i = this;
            this.version = "1.7.26", this.htmlFontSize = 16, this.rAF = function() {}, this.boxWidth = 0, 
            this.boxHeight = 0, "string" == typeof t ? t = {
                el: t
            } : 1 === t.nodeType && (t = {
                el: "",
                divElement: t
            }), t = t, this.config = t, this.data = e, t.flag || (t.flag = "WEB"), t.el && (t.divElement = document.querySelector(t.el)), 
            t.divElement && (t.canvasElement = document.createElement("canvas"), t.divElement.appendChild(t.canvasElement)), 
            t.canvasElement && (t.ctx = t.canvasElement.getContext("2d"), t.canvasElement.setAttribute("package", "lucky-canvas@1.7.26"), 
            t.canvasElement.addEventListener("click", function(t) {
                return i.handleClick(t);
            })), this.ctx = t.ctx, this.initWindowFunction(), this.config.ctx || console.error("无法获取到 CanvasContext2D"), 
            window && "function" == typeof window.addEventListener && window.addEventListener("resize", function(t, e) {
                void 0 === e && (e = 300);
                var i = null;
                return function() {
                    for (var n = this, r = [], o = 0; o < arguments.length; o++) r[o] = arguments[o];
                    i || (i = setTimeout(function() {
                        t.apply(n, r), clearTimeout(i), i = null;
                    }, e));
                };
            }(function() {
                return i.resize();
            }, 300)), window && "function" == typeof window.MutationObserver && new window.MutationObserver(function() {
                i.resize();
            }).observe(document.documentElement, {
                attributes: !0
            });
        }
        return t.prototype.resize = function() {
            var t, e;
            null === (e = (t = this.config).beforeResize) || void 0 === e || e.call(t), this.setHTMLFontSize(), 
            this.setDpr(), this.resetWidthAndHeight(), this.zoomCanvas();
        }, t.prototype.initLucky = function() {
            if (this.resize(), !this.boxWidth || !this.boxHeight) return console.error("无法获取到宽度或高度");
        }, t.prototype.handleClick = function(t) {}, t.prototype.setHTMLFontSize = function() {
            window && (this.htmlFontSize = +window.getComputedStyle(document.documentElement).fontSize.slice(0, -2));
        }, t.prototype.clearCanvas = function() {
            var t = [ this.boxWidth, this.boxHeight ], e = t[0], i = t[1];
            this.ctx.clearRect(-e, -i, 2 * e, 2 * i);
        }, t.prototype.setDpr = function() {
            var t = this.config;
            t.dpr || (window ? window.dpr = t.dpr = window.devicePixelRatio || 1 : t.dpr || console.error(t, "未传入 dpr 可能会导致绘制异常"));
        }, t.prototype.resetWidthAndHeight = function() {
            var t = this.config, e = this.data, i = 0, n = 0;
            t.divElement && (i = t.divElement.offsetWidth, n = t.divElement.offsetHeight), this.boxWidth = this.getLength(e.width || t.width) || i, 
            this.boxHeight = this.getLength(e.height || t.height) || n, t.divElement && (t.divElement.style.overflow = "hidden", 
            t.divElement.style.width = this.boxWidth + "px", t.divElement.style.height = this.boxHeight + "px");
        }, t.prototype.zoomCanvas = function() {
            var t = this.config, e = this.ctx, i = t.canvasElement, n = t.dpr, r = [ this.boxWidth * n, this.boxHeight * n ], o = r[0], s = r[1];
            i && (i.width = o, i.height = s, i.style.width = o + "px", i.style.height = s + "px", 
            i.style["transform-origin"] = "left top", i.style.transform = "scale(" + 1 / n + ")", 
            e.scale(n, n));
        }, t.prototype.initWindowFunction = function() {
            var t = this.config;
            if (window) return this.rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(t) {
                window.setTimeout(t, 1e3 / 60);
            }, t.setTimeout = window.setTimeout, t.setInterval = window.setInterval, t.clearTimeout = window.clearTimeout, 
            void (t.clearInterval = window.clearInterval);
            if (t.rAF) this.rAF = t.rAF; else if (t.setTimeout) {
                var e = t.setTimeout;
                this.rAF = function(t) {
                    return e(t, 16.7);
                };
            } else this.rAF = function(t) {
                return setTimeout(t, 16.7);
            };
        }, t.prototype.isWeb = function() {
            return [ "WEB", "UNI-H5", "TARO-H5" ].includes(this.config.flag);
        }, t.prototype.loadImg = function(t, e, i) {
            var n = this;
            return void 0 === i && (i = "$resolve"), new Promise(function(r, o) {
                if (t || o("=> '" + e.src + "' 不能为空或不合法"), "WEB" !== n.config.flag) return e[i] = r, 
                void (e.$reject = o);
                var s = new Image();
                s.crossorigin = "anonymous", s.onload = function() {
                    return r(s);
                }, s.onerror = function() {
                    return o("=> '" + e.src + "' 图片加载失败");
                }, s.src = t;
            });
        }, t.prototype.drawImage = function(t, e) {
            for (var i, n, r, o = [], s = 2; s < arguments.length; s++) o[s - 2] = arguments[s];
            var a = this.config, c = a.flag, l = a.dpr;
            if ([ "WEB", "MP-WX" ].includes(c)) r = e; else {
                if (![ "UNI-H5", "UNI-MP", "TARO-H5", "TARO-MP" ].includes(c)) return console.error("意料之外的 flag, 该平台尚未兼容!");
                r = e.path;
            }
            var u = null === (n = (i = r.canvas || r).getContext) || void 0 === n ? void 0 : n.call(i, "2d");
            if (u && !this.isWeb()) {
                o = o.map(function(t) {
                    return t * l;
                });
                var f = u.getImageData.apply(u, o.slice(0, 4));
                t.putImageData.apply(t, h([ f ], o.slice(4, 6)));
            } else {
                8 === o.length && (o = o.map(function(t, e) {
                    return e < 4 ? t * l : t;
                }));
                try {
                    t.drawImage.apply(t, h([ r ], o));
                } catch (t) {}
            }
        }, t.prototype.computedWidthAndHeight = function(t, e, i, n) {
            if (!e.width && !e.height) return [ t.width, t.height ];
            if (e.width && !e.height) {
                var r = this.getLength(e.width, i);
                return [ r, t.height * (r / t.width) ];
            }
            if (!e.width && e.height) {
                var o = this.getLength(e.height, n);
                return [ t.width * (o / t.height), o ];
            }
            return [ this.getLength(e.width, i), this.getLength(e.height, n) ];
        }, t.prototype.changeUnits = function(t, e) {
            var i = this;
            void 0 === e && (e = 1);
            var n = this.config;
            return Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/, function(t, r, o) {
                var s = {
                    "%": function(t) {
                        return t * (e / 100);
                    },
                    px: function(t) {
                        return 1 * t;
                    },
                    rem: function(t) {
                        return t * i.htmlFontSize;
                    },
                    vw: function(t) {
                        return t / 100 * window.innerWidth;
                    }
                }[o];
                if (s) return s(r);
                var a = n.handleCssUnit || n.unitFunc;
                return a ? a(r, o) : r;
            }));
        }, t.prototype.getLength = function(t, e) {
            return c(t, "number") ? t : c(t, "string") ? this.changeUnits(t, e) : 0;
        }, t.prototype.getOffsetX = function(t, e) {
            return void 0 === e && (e = 0), (e - t) / 2;
        }, t.prototype.getOffscreenCanvas = function(t, e) {
            if (!l(this, "_offscreenCanvas") && (window && window.document && "WEB" === this.config.flag ? this._offscreenCanvas = document.createElement("canvas") : this._offscreenCanvas = this.config.offscreenCanvas, 
            !this._offscreenCanvas)) return console.error("离屏 Canvas 无法渲染!");
            var i = this.config.dpr, n = this._offscreenCanvas;
            n.width = (t || 300) * i, n.height = (e || 150) * i;
            var r = n.getContext("2d");
            return r.clearRect(0, 0, t, e), r.scale(i, i), r.dpr = i, {
                _offscreenCanvas: n,
                _ctx: r
            };
        }, t.prototype.$set = function(t, e, i) {
            t && "object" == typeof t && z(t, e, i);
        }, t.prototype.$computed = function(t, e, i) {
            var n = this;
            Object.defineProperty(t, e, {
                get: function() {
                    return i.call(n);
                }
            });
        }, t.prototype.$watch = function(t, e, i) {
            void 0 === i && (i = {}), "object" == typeof e && (e = (i = e).handler);
            var n = new k(this, t, e, i);
            return i.immediate && e.call(this, n.value), function() {};
        }, t.version = "1.7.26", t;
    }(), _ = function(t) {
        return Math.PI / 180 * t;
    }, A = function(t) {
        for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
        var n = e[0], r = e[1], o = e[2], s = e[3], a = e[4], h = Math.min(o, s), c = Math.PI;
        a > h / 2 && (a = h / 2), t.beginPath(), t.moveTo(n + a, r), t.lineTo(n + a, r), 
        t.lineTo(n + o - a, r), t.arc(n + o - a, r + a, a, -c / 2, 0), t.lineTo(n + o, r + s - a), 
        t.arc(n + o - a, r + s - a, a, 0, c / 2), t.lineTo(n + a, r + s), t.arc(n + a, r + s - a, a, c / 2, c), 
        t.lineTo(n, r + a), t.arc(n + a, r + a, a, c, -c / 2), t.closePath();
    }, L = function(t, e, i, n) {
        return t >= n && (t = n), i * (t /= n) * t + e;
    }, T = function(t, e, i, n) {
        return t >= n && (t = n), -i * (t /= n) * (t - 2) + e;
    }, W = function(t) {
        function e(e, i) {
            var n, r = t.call(this, e, {
                width: i.width,
                height: i.height
            }) || this;
            return r.blocks = [], r.prizes = [], r.buttons = [], r.defaultConfig = {}, r.defaultStyle = {}, 
            r._defaultConfig = {}, r._defaultStyle = {}, r.Radius = 0, r.prizeRadius = 0, r.prizeDeg = 0, 
            r.prizeAng = 0, r.rotateDeg = 0, r.maxBtnRadius = 0, r.startTime = 0, r.endTime = 0, 
            r.stopDeg = 0, r.endDeg = 0, r.FPS = 16.6, r.step = 0, r.ImageCache = new Map(), 
            r.initData(i), r.initWatch(), r.initComputed(), null === (n = e.beforeCreate) || void 0 === n || n.call(r), 
            r.init(), r;
        }
        return r(e, t), e.prototype.resize = function() {
            var e, i;
            t.prototype.resize.call(this), this.Radius = Math.min(this.boxWidth, this.boxHeight) / 2, 
            this.ctx.translate(this.Radius, this.Radius), this.draw(), null === (i = (e = this.config).afterResize) || void 0 === i || i.call(e);
        }, e.prototype.initLucky = function() {
            this.Radius = 0, this.prizeRadius = 0, this.prizeDeg = 0, this.prizeAng = 0, this.rotateDeg = 0, 
            this.maxBtnRadius = 0, this.startTime = 0, this.endTime = 0, this.stopDeg = 0, this.endDeg = 0, 
            this.FPS = 16.6, this.prizeFlag = -1, this.step = 0, t.prototype.initLucky.call(this);
        }, e.prototype.initData = function(t) {
            this.$set(this, "width", t.width), this.$set(this, "height", t.height), this.$set(this, "blocks", t.blocks || []), 
            this.$set(this, "prizes", t.prizes || []), this.$set(this, "buttons", t.buttons || []), 
            this.$set(this, "defaultConfig", t.defaultConfig || {}), this.$set(this, "defaultStyle", t.defaultStyle || {}), 
            this.$set(this, "startCallback", t.start), this.$set(this, "endCallback", t.end);
        }, e.prototype.initComputed = function() {
            var t = this;
            this.$computed(this, "_defaultConfig", function() {
                return o({
                    gutter: "0px",
                    offsetDegree: 0,
                    speed: 20,
                    speedFunction: "quad",
                    accelerationTime: 2500,
                    decelerationTime: 2500,
                    stopRange: 0
                }, t.defaultConfig);
            }), this.$computed(this, "_defaultStyle", function() {
                return o({
                    fontSize: "18px",
                    fontColor: "#000",
                    fontStyle: "sans-serif",
                    fontWeight: "400",
                    background: "rgba(0,0,0,0)",
                    wordWrap: !0,
                    lengthLimit: "90%"
                }, t.defaultStyle);
            });
        }, e.prototype.initWatch = function() {
            var t = this;
            this.$watch("width", function(e) {
                t.data.width = e, t.resize();
            }), this.$watch("height", function(e) {
                t.data.height = e, t.resize();
            }), this.$watch("blocks", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("prizes", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("buttons", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("defaultConfig", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("defaultStyle", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("startCallback", function() {
                return t.init();
            }), this.$watch("endCallback", function() {
                return t.init();
            });
        }, e.prototype.init = function() {
            var t, e;
            return s(this, void 0, void 0, function() {
                var i;
                return a(this, function(n) {
                    switch (n.label) {
                      case 0:
                        return this.initLucky(), i = this.config, null === (t = i.beforeInit) || void 0 === t || t.call(this), 
                        this.draw(), this.draw(), [ 4, this.initImageCache() ];

                      case 1:
                        return n.sent(), null === (e = i.afterInit) || void 0 === e || e.call(this), [ 2 ];
                    }
                });
            });
        }, e.prototype.initImageCache = function() {
            var t = this;
            return new Promise(function(e) {
                var i = {
                    blocks: t.blocks.map(function(t) {
                        return t.imgs;
                    }),
                    prizes: t.prizes.map(function(t) {
                        return t.imgs;
                    }),
                    buttons: t.buttons.map(function(t) {
                        return t.imgs;
                    })
                };
                Object.keys(i).forEach(function(n) {
                    var r = i[n], o = [];
                    r && r.forEach(function(e, i) {
                        e && e.forEach(function(e, r) {
                            o.push(t.loadAndCacheImg(n, i, r));
                        });
                    }), Promise.all(o).then(function() {
                        t.draw(), e();
                    });
                });
            });
        }, e.prototype.handleClick = function(t) {
            var e, i = this.ctx;
            i.beginPath(), i.arc(0, 0, this.maxBtnRadius, 0, 2 * Math.PI, !1), i.isPointInPath(t.offsetX, t.offsetY) && 0 === this.step && (null === (e = this.startCallback) || void 0 === e || e.call(this, t));
        }, e.prototype.loadAndCacheImg = function(t, e, i) {
            return s(this, void 0, void 0, function() {
                var n = this;
                return a(this, function(r) {
                    return [ 2, new Promise(function(r, o) {
                        var h = n[t][e];
                        if (h && h.imgs) {
                            var c = h.imgs[i];
                            c && n.loadImg(c.src, c).then(function(t) {
                                return s(n, void 0, void 0, function() {
                                    return a(this, function(e) {
                                        switch (e.label) {
                                          case 0:
                                            return "function" != typeof c.formatter ? [ 3, 2 ] : [ 4, Promise.resolve(c.formatter.call(this, t)) ];

                                          case 1:
                                            t = e.sent(), e.label = 2;

                                          case 2:
                                            return this.ImageCache.set(c.src, t), r(), [ 2 ];
                                        }
                                    });
                                });
                            }).catch(function(n) {
                                console.error(t + "[" + e + "].imgs[" + i + "] " + n), o();
                            });
                        }
                    }) ];
                });
            });
        }, e.prototype.drawBlock = function(t, e, i) {
            var n = this, r = this.ctx;
            f(e.background) && (r.beginPath(), r.fillStyle = e.background, r.arc(0, 0, t, 0, 2 * Math.PI, !1), 
            r.fill()), e.imgs && e.imgs.forEach(function(e, i) {
                var o = n.ImageCache.get(e.src);
                if (o) {
                    var s = n.computedWidthAndHeight(o, e, 2 * t, 2 * t), a = s[0], h = s[1], c = [ n.getOffsetX(a) + n.getLength(e.left, 2 * t), n.getLength(e.top, 2 * t) - t ], l = c[0], u = c[1];
                    r.save(), e.rotate && r.rotate(_(n.rotateDeg)), n.drawImage(r, o, l, u, a, h), r.restore();
                }
            });
        }, e.prototype.draw = function() {
            var t, e, i = this, n = this, r = n.config, o = n.ctx, s = n._defaultConfig, a = n._defaultStyle;
            null === (t = r.beforeDraw) || void 0 === t || t.call(this, o), o.clearRect(-this.Radius, -this.Radius, 2 * this.Radius, 2 * this.Radius), 
            this.prizeRadius = this.blocks.reduce(function(t, e, n) {
                return i.drawBlock(t, e, n), t - i.getLength(e.padding && e.padding.split(" ")[0]);
            }, this.Radius), this.prizeDeg = 360 / this.prizes.length, this.prizeAng = _(this.prizeDeg);
            var h = this.prizeRadius * Math.sin(this.prizeAng / 2) * 2, c = _(this.rotateDeg - 90 + this.prizeDeg / 2 + s.offsetDegree), d = function(t, e) {
                return i.getOffsetX(o.measureText(e).width) + i.getLength(t.left, h);
            }, p = function(t, e, n) {
                var r = t.lineHeight || a.lineHeight || t.fontSize || a.fontSize;
                return i.getLength(t.top, e) + (n + 1) * i.getLength(r);
            };
            o.save(), this.prizes.forEach(function(t, e) {
                var n = c + e * i.prizeAng, r = i.prizeRadius - i.maxBtnRadius, v = t.background || a.background;
                f(v) && (o.fillStyle = v, function(t, e, i, n, r, o) {
                    t.beginPath();
                    var s, a, h = _(90 / Math.PI / i * o), c = n + h, l = r - h;
                    t.arc(0, 0, i, c, l, !1), t.lineTo.apply(t, (s = (n + r) / 2, a = o / 2 / Math.abs(Math.sin((n - r) / 2)), 
                    [ +(Math.cos(s) * a).toFixed(8), +(Math.sin(s) * a).toFixed(8) ])), t.closePath();
                }(o, i.maxBtnRadius, i.prizeRadius, n - i.prizeAng / 2, n + i.prizeAng / 2, i.getLength(s.gutter)), 
                o.fill());
                var m = Math.cos(n) * i.prizeRadius, w = Math.sin(n) * i.prizeRadius;
                o.translate(m, w), o.rotate(n + _(90)), t.imgs && t.imgs.forEach(function(t, e) {
                    var n = i.ImageCache.get(t.src);
                    if (n) {
                        var s = i.computedWidthAndHeight(n, t, i.prizeAng * i.prizeRadius, r), a = s[0], c = s[1], l = [ i.getOffsetX(a) + i.getLength(t.left, h), i.getLength(t.top, r) ], u = l[0], f = l[1];
                        i.drawImage(o, n, u, f, a, c);
                    }
                }), t.fonts && t.fonts.forEach(function(t) {
                    var e = t.fontColor || a.fontColor, n = t.fontWeight || a.fontWeight, h = i.getLength(t.fontSize || a.fontSize), c = t.fontStyle || a.fontStyle, f = l(t, "wordWrap") ? t.wordWrap : a.wordWrap, v = t.lengthLimit || a.lengthLimit, m = t.lineClamp || a.lineClamp;
                    o.fillStyle = e, o.font = n + " " + (h >> 0) + "px " + c;
                    var w = String(t.text);
                    (f ? g(o, u(w), function(e) {
                        var n = (i.prizeRadius - p(t, r, e.length)) * Math.tan(i.prizeAng / 2) * 2 - i.getLength(s.gutter);
                        return i.getLength(v, n);
                    }, m) : w.split("\n")).filter(function(t) {
                        return !!t;
                    }).forEach(function(e, i) {
                        o.fillText(e, d(t, e), p(t, r, i));
                    });
                }), o.rotate(_(360) - n - _(90)), o.translate(-m, -w);
            }), o.restore(), this.buttons.forEach(function(t, e) {
                var n = i.getLength(t.radius, i.prizeRadius);
                i.maxBtnRadius = Math.max(i.maxBtnRadius, n), f(t.background) && (o.beginPath(), 
                o.fillStyle = t.background, o.arc(0, 0, n, 0, 2 * Math.PI, !1), o.fill()), t.pointer && f(t.background) && (o.beginPath(), 
                o.fillStyle = t.background, o.moveTo(-n, 0), o.lineTo(n, 0), o.lineTo(0, 2 * -n), 
                o.closePath(), o.fill()), t.imgs && t.imgs.forEach(function(t, e) {
                    var r = i.ImageCache.get(t.src);
                    if (r) {
                        var s = i.computedWidthAndHeight(r, t, 2 * n, 2 * n), a = s[0], h = s[1], c = [ i.getOffsetX(a) + i.getLength(t.left, n), i.getLength(t.top, n) ], l = c[0], u = c[1];
                        i.drawImage(o, r, l, u, a, h);
                    }
                }), t.fonts && t.fonts.forEach(function(t) {
                    var e = t.fontColor || a.fontColor, r = t.fontWeight || a.fontWeight, s = i.getLength(t.fontSize || a.fontSize), h = t.fontStyle || a.fontStyle;
                    o.fillStyle = e, o.font = r + " " + (s >> 0) + "px " + h, String(t.text).split("\n").forEach(function(e, i) {
                        o.fillText(e, d(t, e), p(t, n, i));
                    });
                });
            }), null === (e = r.afterDraw) || void 0 === e || e.call(this, o);
        }, e.prototype.carveOnGunwaleOfAMovingBoat = function() {
            var t = this, e = t._defaultConfig, i = t.prizeFlag, n = t.prizeDeg, r = t.rotateDeg;
            this.endTime = Date.now();
            for (var o = this.stopDeg = r, s = e.speed, a = (Math.random() * n - n / 2) * this.getLength(e.stopRange), h = 0, c = 0, l = 0; ++h; ) {
                var u = 360 * h - i * n - r - e.offsetDegree + a - n / 2, f = T(this.FPS, o, u, e.decelerationTime) - o;
                if (f > s) {
                    this.endDeg = s - c > f - s ? u : l;
                    break;
                }
                l = u, c = f;
            }
        }, e.prototype.play = function() {
            var t, e;
            0 === this.step && (this.startTime = Date.now(), this.prizeFlag = void 0, this.step = 1, 
            null === (e = (t = this.config).afterStart) || void 0 === e || e.call(t), this.run());
        }, e.prototype.stop = function(t) {
            if (0 !== this.step && 3 !== this.step) {
                if (!t && 0 !== t) {
                    var e = this.prizes.map(function(t) {
                        return t.range;
                    });
                    t = p(e);
                }
                t < 0 ? (this.step = 0, this.prizeFlag = -1) : (this.step = 2, this.prizeFlag = t % this.prizes.length);
            }
        }, e.prototype.run = function(t) {
            var e;
            void 0 === t && (t = 0);
            var i = this, n = i.rAF, r = i.step, o = i.prizeFlag, s = i._defaultConfig, a = s.accelerationTime, h = s.decelerationTime, c = s.speed;
            if (0 !== r) {
                if (-1 !== o) {
                    3 !== r || this.endDeg || this.carveOnGunwaleOfAMovingBoat();
                    var l = Date.now() - this.startTime, u = Date.now() - this.endTime, f = this.rotateDeg;
                    if (1 === r || l < a) {
                        this.FPS = l / t;
                        var d = L(l, 0, c, a);
                        d === c && (this.step = 2), f += d % 360;
                    } else 2 === r ? (f += c % 360, void 0 !== o && o >= 0 && (this.step = 3, this.stopDeg = 0, 
                    this.endDeg = 0)) : 3 === r ? (f = T(u, this.stopDeg, this.endDeg, h), u >= h && (this.step = 0)) : this.stop(-1);
                    this.rotateDeg = f, this.draw(), n(this.run.bind(this, t + 1));
                }
            } else null === (e = this.endCallback) || void 0 === e || e.call(this, this.prizes.find(function(t, e) {
                return e === o;
            }) || {});
        }, e.prototype.conversionAxis = function(t, e) {
            var i = this.config;
            return [ t / i.dpr - this.Radius, e / i.dpr - this.Radius ];
        }, e;
    }(I), E = function(t) {
        function e(e, i) {
            var n, r = t.call(this, e, {
                width: i.width,
                height: i.height
            }) || this;
            return r.rows = 3, r.cols = 3, r.blocks = [], r.prizes = [], r.buttons = [], r.defaultConfig = {}, 
            r.defaultStyle = {}, r.activeStyle = {}, r._defaultConfig = {}, r._defaultStyle = {}, 
            r._activeStyle = {}, r.cellWidth = 0, r.cellHeight = 0, r.startTime = 0, r.endTime = 0, 
            r.currIndex = 0, r.stopIndex = 0, r.endIndex = 0, r.demo = !1, r.timer = 0, r.FPS = 16.6, 
            r.step = 0, r.prizeFlag = -1, r.cells = [], r.ImageCache = new Map(), r.initData(i), 
            r.initWatch(), r.initComputed(), null === (n = e.beforeCreate) || void 0 === n || n.call(r), 
            r.init(), r;
        }
        return r(e, t), e.prototype.resize = function() {
            var e, i;
            t.prototype.resize.call(this), this.draw(), null === (i = (e = this.config).afterResize) || void 0 === i || i.call(e);
        }, e.prototype.initLucky = function() {
            this.cellWidth = 0, this.cellHeight = 0, this.startTime = 0, this.endTime = 0, this.currIndex = 0, 
            this.stopIndex = 0, this.endIndex = 0, this.demo = !1, this.timer = 0, this.FPS = 16.6, 
            this.prizeFlag = -1, this.step = 0, t.prototype.initLucky.call(this);
        }, e.prototype.initData = function(t) {
            this.$set(this, "width", t.width), this.$set(this, "height", t.height), this.$set(this, "rows", Number(t.rows) || 3), 
            this.$set(this, "cols", Number(t.cols) || 3), this.$set(this, "blocks", t.blocks || []), 
            this.$set(this, "prizes", t.prizes || []), this.$set(this, "buttons", t.buttons || []), 
            this.$set(this, "button", t.button), this.$set(this, "defaultConfig", t.defaultConfig || {}), 
            this.$set(this, "defaultStyle", t.defaultStyle || {}), this.$set(this, "activeStyle", t.activeStyle || {}), 
            this.$set(this, "startCallback", t.start), this.$set(this, "endCallback", t.end);
        }, e.prototype.initComputed = function() {
            var t = this;
            this.$computed(this, "_defaultConfig", function() {
                var e = o({
                    gutter: 5,
                    speed: 20,
                    accelerationTime: 2500,
                    decelerationTime: 2500
                }, t.defaultConfig);
                return e.gutter = t.getLength(e.gutter), e.speed = e.speed / 40, e;
            }), this.$computed(this, "_defaultStyle", function() {
                return o({
                    borderRadius: 20,
                    fontColor: "#000",
                    fontSize: "18px",
                    fontStyle: "sans-serif",
                    fontWeight: "400",
                    background: "rgba(0,0,0,0)",
                    shadow: "",
                    wordWrap: !0,
                    lengthLimit: "90%"
                }, t.defaultStyle);
            }), this.$computed(this, "_activeStyle", function() {
                return o({
                    background: "#ffce98",
                    shadow: ""
                }, t.activeStyle);
            });
        }, e.prototype.initWatch = function() {
            var t = this;
            this.$watch("width", function(e) {
                t.data.width = e, t.resize();
            }), this.$watch("height", function(e) {
                t.data.height = e, t.resize();
            }), this.$watch("blocks", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("prizes", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("buttons", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("rows", function() {
                return t.init();
            }), this.$watch("cols", function() {
                return t.init();
            }), this.$watch("defaultConfig", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("defaultStyle", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("activeStyle", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("startCallback", function() {
                return t.init();
            }), this.$watch("endCallback", function() {
                return t.init();
            });
        }, e.prototype.init = function() {
            var t, e;
            return s(this, void 0, void 0, function() {
                var i;
                return a(this, function(n) {
                    switch (n.label) {
                      case 0:
                        return this.initLucky(), i = this.config, null === (t = i.beforeInit) || void 0 === t || t.call(this), 
                        this.draw(), [ 4, this.initImageCache() ];

                      case 1:
                        return n.sent(), null === (e = i.afterInit) || void 0 === e || e.call(this), [ 2 ];
                    }
                });
            });
        }, e.prototype.initImageCache = function() {
            var t = this;
            return new Promise(function(e) {
                var i = t.buttons.map(function(t) {
                    return t.imgs;
                });
                t.button && i.push(t.button.imgs);
                var n = {
                    blocks: t.blocks.map(function(t) {
                        return t.imgs;
                    }),
                    prizes: t.prizes.map(function(t) {
                        return t.imgs;
                    }),
                    buttons: i
                };
                Object.keys(n).forEach(function(i) {
                    var r = n[i], o = [];
                    r && r.forEach(function(e, n) {
                        e && e.forEach(function(e, r) {
                            o.push(t.loadAndCacheImg(i, n, r));
                        });
                    }), Promise.all(o).then(function() {
                        t.draw(), e();
                    });
                });
            });
        }, e.prototype.handleClick = function(t) {
            var e = this, i = this.ctx;
            h(h([], this.buttons), [ this.button ]).forEach(function(n) {
                var r;
                if (n) {
                    var o = e.getGeometricProperty([ n.x, n.y, n.col || 1, n.row || 1 ]), s = o[0], a = o[1], h = o[2], c = o[3];
                    i.beginPath(), i.rect(s, a, h, c), i.isPointInPath(t.offsetX, t.offsetY) && 0 === e.step && ("function" == typeof n.callback && n.callback.call(e, n), 
                    null === (r = e.startCallback) || void 0 === r || r.call(e, t, n));
                }
            });
        }, e.prototype.loadAndCacheImg = function(t, e, i) {
            return s(this, void 0, void 0, function() {
                var n = this;
                return a(this, function(r) {
                    return [ 2, new Promise(function(r, o) {
                        var h = n[t][e];
                        if ("buttons" === t && !n.buttons.length && n.button && (h = n.button), h && h.imgs) {
                            var c = h.imgs[i];
                            if (c) {
                                var l = [ n.loadImg(c.src, c), c.activeSrc && n.loadImg(c.activeSrc, c, "$activeResolve") ];
                                Promise.all(l).then(function(t) {
                                    var e = t[0], i = t[1];
                                    return s(n, void 0, void 0, function() {
                                        var t;
                                        return a(this, function(n) {
                                            switch (n.label) {
                                              case 0:
                                                return "function" != typeof (t = c.formatter) ? [ 3, 3 ] : [ 4, Promise.resolve(t.call(this, e)) ];

                                              case 1:
                                                return e = n.sent(), i ? [ 4, Promise.resolve(t.call(this, i)) ] : [ 3, 3 ];

                                              case 2:
                                                i = n.sent(), n.label = 3;

                                              case 3:
                                                return this.ImageCache.set(c.src, e), i && this.ImageCache.set(c.activeSrc, i), 
                                                r(), [ 2 ];
                                            }
                                        });
                                    });
                                }).catch(function(n) {
                                    console.error(t + "[" + e + "].imgs[" + i + "] " + n), o();
                                });
                            }
                        }
                    }) ];
                });
            });
        }, e.prototype.draw = function() {
            var t, e, i = this, n = this, r = n.config, o = n.ctx, s = n._defaultConfig, a = n._defaultStyle, c = n._activeStyle;
            null === (t = r.beforeDraw) || void 0 === t || t.call(this, o), o.clearRect(0, 0, this.boxWidth, this.boxHeight), 
            this.cells = h(h([], this.prizes), this.buttons), this.button && this.cells.push(this.button), 
            this.cells.forEach(function(t) {
                t.col = t.col || 1, t.row = t.row || 1;
            }), this.prizeArea = this.blocks.reduce(function(t, e, n) {
                var r = t.x, s = t.y, a = t.w, h = t.h, c = d(e, i.getLength.bind(i)), l = c[0], u = c[1], p = c[2], g = c[3], v = e.borderRadius ? i.getLength(e.borderRadius) : 0, m = e.background;
                return f(m) && (o.fillStyle = i.handleBackground(r, s, a, h, m), A(o, r, s, a, h, v), 
                o.fill()), e.imgs && e.imgs.forEach(function(t, e) {
                    var n = i.ImageCache.get(t.src);
                    if (n) {
                        var c = i.computedWidthAndHeight(n, t, a, h), l = c[0], u = c[1], f = [ i.getOffsetX(l, a) + i.getLength(t.left, a), i.getLength(t.top, h) ], d = f[0], p = f[1];
                        i.drawImage(o, n, r + d, s + p, l, u);
                    }
                }), {
                    x: r + p,
                    y: s + l,
                    w: a - p - g,
                    h: h - l - u
                };
            }, {
                x: 0,
                y: 0,
                w: this.boxWidth,
                h: this.boxHeight
            }), this.cellWidth = (this.prizeArea.w - s.gutter * (this.cols - 1)) / this.cols, 
            this.cellHeight = (this.prizeArea.h - s.gutter * (this.rows - 1)) / this.rows, this.cells.forEach(function(t, e) {
                var n = i.getGeometricProperty([ t.x, t.y, t.col, t.row ]), s = n[0], h = n[1], d = n[2], p = n[3], v = !1;
                (void 0 === i.prizeFlag || i.prizeFlag > -1) && (v = e === i.currIndex % i.prizes.length >> 0);
                var m = v ? c.background : t.background || a.background;
                if (f(m)) {
                    var w = (v ? c.shadow : t.shadow || a.shadow).replace(/px/g, "").split(",")[0].split(" ").map(function(t, e) {
                        return e < 3 ? Number(t) : t;
                    });
                    4 === w.length && (o.shadowColor = w[3], o.shadowOffsetX = w[0] * r.dpr, o.shadowOffsetY = w[1] * r.dpr, 
                    o.shadowBlur = w[2], w[0] > 0 ? d -= w[0] : (d += w[0], s -= w[0]), w[1] > 0 ? p -= w[1] : (p += w[1], 
                    h -= w[1])), o.fillStyle = i.handleBackground(s, h, d, p, m);
                    var y = i.getLength(t.borderRadius ? t.borderRadius : a.borderRadius);
                    A(o, s, h, d, p, y), o.fill(), o.shadowColor = "rgba(0, 0, 0, 0)", o.shadowOffsetX = 0, 
                    o.shadowOffsetY = 0, o.shadowBlur = 0;
                }
                e >= i.prizes.length && (e -= i.prizes.length), t.imgs && t.imgs.forEach(function(t, e) {
                    var n = i.ImageCache.get(t.src), r = i.ImageCache.get(t.activeSrc);
                    if (n) {
                        var a = v && r || n;
                        if (a) {
                            var c = i.computedWidthAndHeight(a, t, d, p), l = c[0], u = c[1], f = [ s + i.getOffsetX(l, d) + i.getLength(t.left, d), h + i.getLength(t.top, p) ], g = f[0], m = f[1];
                            i.drawImage(o, a, g, m, l, u);
                        }
                    }
                }), t.fonts && t.fonts.forEach(function(t) {
                    var e = v && c.fontStyle ? c.fontStyle : t.fontStyle || a.fontStyle, n = v && c.fontWeight ? c.fontWeight : t.fontWeight || a.fontWeight, r = v && c.fontSize ? i.getLength(c.fontSize) : i.getLength(t.fontSize || a.fontSize), f = v && c.lineHeight ? c.lineHeight : t.lineHeight || a.lineHeight || t.fontSize || a.fontSize, m = l(t, "wordWrap") ? t.wordWrap : a.wordWrap, w = t.lengthLimit || a.lengthLimit, y = t.lineClamp || a.lineClamp;
                    o.font = n + " " + (r >> 0) + "px " + e, o.fillStyle = v && c.fontColor ? c.fontColor : t.fontColor || a.fontColor;
                    var b = [], S = String(t.text);
                    if (m) {
                        var C = i.getLength(w, d);
                        b = g(o, u(S), function() {
                            return C;
                        }, y);
                    } else b = S.split("\n");
                    b.forEach(function(e, n) {
                        o.fillText(e, s + i.getOffsetX(o.measureText(e).width, d) + i.getLength(t.left, d), h + i.getLength(t.top, p) + (n + 1) * i.getLength(f));
                    });
                });
            }), null === (e = r.afterDraw) || void 0 === e || e.call(this, o);
        }, e.prototype.handleBackground = function(t, e, i, n, r) {
            var o = this.ctx;
            return r.includes("linear-gradient") && (r = function(t, e, i, n, r, o) {
                var s = /linear-gradient\((.+)\)/.exec(o)[1].split(",").map(function(t) {
                    return t.trim();
                }), a = s.shift(), h = [ 0, 0, 0, 0 ];
                if (a.includes("deg")) {
                    var c = function(t) {
                        return Math.tan(t / 180 * Math.PI);
                    };
                    (a = a.slice(0, -3) % 360) >= 0 && a < 45 ? h = [ e, i + r, e + n, i + r - n * c(a - 0) ] : a >= 45 && a < 90 ? h = [ e, i + r, e + n - r * c(a - 45), i ] : a >= 90 && a < 135 ? h = [ e + n, i + r, e + n - r * c(a - 90), i ] : a >= 135 && a < 180 ? h = [ e + n, i + r, e, i + n * c(a - 135) ] : a >= 180 && a < 225 ? h = [ e + n, i, e, i + n * c(a - 180) ] : a >= 225 && a < 270 ? h = [ e + n, i, e + r * c(a - 225), i + r ] : a >= 270 && a < 315 ? h = [ e, i, e + r * c(a - 270), i + r ] : a >= 315 && a < 360 && (h = [ e, i, e + n, i + r - n * c(a - 315) ]);
                } else a.includes("top") ? h = [ e, i + r, e, i ] : a.includes("bottom") ? h = [ e, i, e, i + r ] : a.includes("left") ? h = [ e + n, i, e, i ] : a.includes("right") && (h = [ e, i, e + n, i ]);
                var l = t.createLinearGradient.apply(t, h.map(function(t) {
                    return t >> 0;
                }));
                return s.reduce(function(t, e, i) {
                    var n = e.split(" ");
                    return 1 === n.length ? t.addColorStop(i, n[0]) : 2 === n.length && t.addColorStop.apply(t, n), 
                    t;
                }, l);
            }(o, t, e, i, n, r)), r;
        }, e.prototype.carveOnGunwaleOfAMovingBoat = function() {
            var t = this, e = t._defaultConfig, i = t.prizeFlag, n = t.currIndex;
            this.endTime = Date.now();
            for (var r = this.stopIndex = n, o = e.speed, s = 0, a = 0, h = 0; ++s; ) {
                var c = this.prizes.length * s + i - r, l = T(this.FPS, r, c, e.decelerationTime) - r;
                if (l > o) {
                    this.endIndex = o - a > l - o ? c : h;
                    break;
                }
                h = c, a = l;
            }
        }, e.prototype.play = function() {
            var t, e;
            0 === this.step && (this.startTime = Date.now(), this.prizeFlag = void 0, this.step = 1, 
            null === (e = (t = this.config).afterStart) || void 0 === e || e.call(t), this.run());
        }, e.prototype.stop = function(t) {
            if (0 !== this.step && 3 !== this.step) {
                if (!t && 0 !== t) {
                    var e = this.prizes.map(function(t) {
                        return t.range;
                    });
                    t = p(e);
                }
                t < 0 ? (this.step = 0, this.prizeFlag = -1) : (this.step = 2, this.prizeFlag = t % this.prizes.length);
            }
        }, e.prototype.run = function(t) {
            var e;
            void 0 === t && (t = 0);
            var i = this, n = i.rAF, r = i.step, o = i.prizes, s = i.prizeFlag, a = i._defaultConfig, h = a.accelerationTime, c = a.decelerationTime, l = a.speed;
            if (0 !== r) {
                if (-1 !== s) {
                    3 !== r || this.endIndex || this.carveOnGunwaleOfAMovingBoat();
                    var u = Date.now() - this.startTime, f = Date.now() - this.endTime, d = this.currIndex;
                    if (1 === r || u < h) {
                        this.FPS = u / t;
                        var p = L(u, .1, l - .1, h);
                        p === l && (this.step = 2), d += p % o.length;
                    } else 2 === r ? (d += l % o.length, void 0 !== s && s >= 0 && (this.step = 3, this.stopIndex = 0, 
                    this.endIndex = 0)) : 3 === r ? (d = T(f, this.stopIndex, this.endIndex, c), f >= c && (this.step = 0)) : this.stop(-1);
                    this.currIndex = d, this.draw(), n(this.run.bind(this, t + 1));
                }
            } else null === (e = this.endCallback) || void 0 === e || e.call(this, this.prizes.find(function(t, e) {
                return e === s;
            }) || {});
        }, e.prototype.getGeometricProperty = function(t) {
            var e = t[0], i = t[1], n = t[2], r = void 0 === n ? 1 : n, o = t[3], s = void 0 === o ? 1 : o, a = this.cellWidth, h = this.cellHeight, c = this._defaultConfig.gutter, l = [ this.prizeArea.x + (a + c) * e, this.prizeArea.y + (h + c) * i ];
            return r && s && l.push(a * r + c * (r - 1), h * s + c * (s - 1)), l;
        }, e.prototype.conversionAxis = function(t, e) {
            var i = this.config;
            return [ t / i.dpr, e / i.dpr ];
        }, e;
    }(I), O = function(t) {
        function e(e, i) {
            var n, r = t.call(this, e, {
                width: i.width,
                height: i.height
            }) || this;
            return r.blocks = [], r.prizes = [], r.slots = [], r.defaultConfig = {}, r._defaultConfig = {}, 
            r.defaultStyle = {}, r._defaultStyle = {}, r.endCallback = function() {}, r.cellWidth = 0, 
            r.cellHeight = 0, r.cellAndSpacing = 0, r.widthAndSpacing = 0, r.heightAndSpacing = 0, 
            r.FPS = 16.6, r.scroll = [], r.stopScroll = [], r.endScroll = [], r.startTime = 0, 
            r.endTime = 0, r.step = 0, r.prizeFlag = void 0, r.ImageCache = new Map(), r.initData(i), 
            r.initWatch(), r.initComputed(), null === (n = e.beforeCreate) || void 0 === n || n.call(r), 
            r.init(), r;
        }
        return r(e, t), e.prototype.resize = function() {
            var e, i;
            t.prototype.resize.call(this), this.draw(), null === (i = (e = this.config).afterResize) || void 0 === i || i.call(e);
        }, e.prototype.initLucky = function() {
            this.cellWidth = 0, this.cellHeight = 0, this.cellAndSpacing = 0, this.widthAndSpacing = 0, 
            this.heightAndSpacing = 0, this.FPS = 16.6, this.scroll = [], this.stopScroll = [], 
            this.endScroll = [], this.startTime = 0, this.endTime = 0, this.prizeFlag = void 0, 
            this.step = 0, t.prototype.initLucky.call(this);
        }, e.prototype.initData = function(t) {
            this.$set(this, "width", t.width), this.$set(this, "height", t.height), this.$set(this, "blocks", t.blocks || []), 
            this.$set(this, "prizes", t.prizes || []), this.$set(this, "slots", t.slots || []), 
            this.$set(this, "defaultConfig", t.defaultConfig || {}), this.$set(this, "defaultStyle", t.defaultStyle || {}), 
            this.$set(this, "endCallback", t.end);
        }, e.prototype.initComputed = function() {
            var t = this;
            this.$computed(this, "_defaultConfig", function() {
                var e = o({
                    mode: "vertical",
                    rowSpacing: 0,
                    colSpacing: 5,
                    speed: 20,
                    direction: 1,
                    accelerationTime: 2500,
                    decelerationTime: 2500
                }, t.defaultConfig);
                return e.rowSpacing = t.getLength(e.rowSpacing), e.colSpacing = t.getLength(e.colSpacing), 
                e;
            }), this.$computed(this, "_defaultStyle", function() {
                return o({
                    borderRadius: 0,
                    fontColor: "#000",
                    fontSize: "18px",
                    fontStyle: "sans-serif",
                    fontWeight: "400",
                    background: "rgba(0,0,0,0)",
                    wordWrap: !0,
                    lengthLimit: "90%"
                }, t.defaultStyle);
            });
        }, e.prototype.initWatch = function() {
            var t = this;
            this.$watch("width", function(e) {
                t.data.width = e, t.resize();
            }), this.$watch("height", function(e) {
                t.data.height = e, t.resize();
            }), this.$watch("blocks", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("prizes", function(e) {
                t.initImageCache();
            }, {
                deep: !0
            }), this.$watch("slots", function(e) {
                t.drawOffscreenCanvas(), t.draw();
            }, {
                deep: !0
            }), this.$watch("defaultConfig", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("defaultStyle", function() {
                return t.draw();
            }, {
                deep: !0
            }), this.$watch("endCallback", function() {
                return t.init();
            });
        }, e.prototype.init = function() {
            var t, e;
            return s(this, void 0, void 0, function() {
                var i;
                return a(this, function(n) {
                    switch (n.label) {
                      case 0:
                        return this.initLucky(), i = this.config, null === (t = i.beforeInit) || void 0 === t || t.call(this), 
                        this.drawOffscreenCanvas(), this.draw(), [ 4, this.initImageCache() ];

                      case 1:
                        return n.sent(), null === (e = i.afterInit) || void 0 === e || e.call(this), [ 2 ];
                    }
                });
            });
        }, e.prototype.initImageCache = function() {
            var t = this;
            return new Promise(function(e) {
                var i = {
                    blocks: t.blocks.map(function(t) {
                        return t.imgs;
                    }),
                    prizes: t.prizes.map(function(t) {
                        return t.imgs;
                    })
                };
                Object.keys(i).forEach(function(n) {
                    var r = i[n], o = [];
                    r && r.forEach(function(e, i) {
                        e && e.forEach(function(e, r) {
                            o.push(t.loadAndCacheImg(n, i, r));
                        });
                    }), Promise.all(o).then(function() {
                        t.drawOffscreenCanvas(), t.draw(), e();
                    });
                });
            });
        }, e.prototype.loadAndCacheImg = function(t, e, i) {
            return s(this, void 0, void 0, function() {
                var n = this;
                return a(this, function(r) {
                    return [ 2, new Promise(function(r, o) {
                        var h = n[t][e];
                        if (h && h.imgs) {
                            var c = h.imgs[i];
                            c && n.loadImg(c.src, c).then(function(t) {
                                return s(n, void 0, void 0, function() {
                                    return a(this, function(e) {
                                        switch (e.label) {
                                          case 0:
                                            return "function" != typeof c.formatter ? [ 3, 2 ] : [ 4, Promise.resolve(c.formatter.call(this, t)) ];

                                          case 1:
                                            t = e.sent(), e.label = 2;

                                          case 2:
                                            return this.ImageCache.set(c.src, t), r(), [ 2 ];
                                        }
                                    });
                                });
                            }).catch(function(n) {
                                console.error(t + "[" + e + "].imgs[" + i + "] " + n), o();
                            });
                        }
                    }) ];
                });
            });
        }, e.prototype.drawOffscreenCanvas = function() {
            var t = this, e = this._defaultConfig, i = this._defaultStyle, n = this.drawBlocks(), r = n.w, o = n.h, s = this.prizes.length, a = this.displacementWidthOrHeight(), h = a.cellWidth, c = a.cellHeight, d = a.widthAndSpacing, p = a.heightAndSpacing, v = new Array(s).fill(void 0).map(function(t, e) {
                return e;
            }), m = 0, w = 0;
            this.slots.forEach(function(e, i) {
                void 0 === t.scroll[i] && (t.scroll[i] = 0), e.order = e.order || v;
                var n = e.order.length;
                m = Math.max(m, r + d * n), w = Math.max(w, o + p * n);
            });
            var y = this.getOffscreenCanvas(m, w), b = y._offscreenCanvas, S = y._ctx;
            this._offscreenCanvas = b, this.slots.forEach(function(n, r) {
                var o = h * r, s = c * r, a = 0, v = function(t, e) {
                    for (var i = {}, n = [], r = 0; r < t.length; r++) i[r] = t[r];
                    for (r = 0; r < e.length; r++) {
                        var o = i[e[r]];
                        o && (n[r] = o);
                    }
                    return n;
                }(t.prizes, n.order);
                if (v.length) {
                    v.forEach(function(r, v) {
                        if (r) {
                            n.order[v];
                            var m = d * v + e.colSpacing / 2, w = p * v + e.rowSpacing / 2, y = t.displacement([ o, w, p ], [ m, s, d ]), b = y[0], C = y[1], z = y[2];
                            a += z;
                            var x = r.background || i.background;
                            if (f(x)) {
                                var k = t.getLength(l(r, "borderRadius") ? r.borderRadius : i.borderRadius);
                                A(S, b, C, h, h, k), S.fillStyle = x, S.fill();
                            }
                            r.imgs && r.imgs.forEach(function(e, i) {
                                var n = t.ImageCache.get(e.src);
                                if (n) {
                                    var r = t.computedWidthAndHeight(n, e, h, c), o = r[0], s = r[1], a = [ b + t.getOffsetX(o, h) + t.getLength(e.left, h), C + t.getLength(e.top, c) ], l = a[0], u = a[1];
                                    t.drawImage(S, n, l, u, o, s);
                                }
                            }), r.fonts && r.fonts.forEach(function(e) {
                                var n = e.fontStyle || i.fontStyle, r = e.fontWeight || i.fontWeight, o = t.getLength(e.fontSize || i.fontSize), s = e.lineHeight || i.lineHeight || e.fontSize || i.fontSize, a = l(e, "wordWrap") ? e.wordWrap : i.wordWrap, f = e.lengthLimit || i.lengthLimit, d = e.lineClamp || i.lineClamp;
                                S.font = r + " " + (o >> 0) + "px " + n, S.fillStyle = e.fontColor || i.fontColor;
                                var p = [], v = String(e.text);
                                if (a) {
                                    var m = t.getLength(f, h);
                                    p = g(S, u(v), function() {
                                        return m;
                                    }, d);
                                } else p = v.split("\n");
                                p.forEach(function(i, n) {
                                    S.fillText(i, b + t.getOffsetX(S.measureText(i).width, h) + t.getLength(e.left, h), C + t.getLength(e.top, c) + (n + 1) * t.getLength(s));
                                });
                            });
                        }
                    });
                    for (var m = t.displacement([ o, 0, h, a ], [ 0, s, a, c ]), y = m[0], C = m[1], z = m[2], x = m[3], k = a; k < w + a; ) {
                        var I = t.displacement([ y, k ], [ k, C ]), _ = I[0], L = I[1];
                        t.drawImage(S, b, y, C, z, x, _, L, z, x), k += a;
                    }
                }
            });
        }, e.prototype.drawBlocks = function() {
            var t = this, e = this;
            e.config;
            var i = e.ctx;
            e._defaultConfig;
            var n = e._defaultStyle;
            return this.prizeArea = this.blocks.reduce(function(e, r, o) {
                var s = e.x, a = e.y, h = e.w, c = e.h, l = d(r, t.getLength.bind(t)), u = l[0], p = l[1], g = l[2], v = l[3], m = r.borderRadius ? t.getLength(r.borderRadius) : 0, w = r.background || n.background;
                return f(w) && (A(i, s, a, h, c, m), i.fillStyle = w, i.fill()), r.imgs && r.imgs.forEach(function(e, n) {
                    var r = t.ImageCache.get(e.src);
                    if (r) {
                        var o = t.computedWidthAndHeight(r, e, h, c), l = o[0], u = o[1], f = [ t.getOffsetX(l, h) + t.getLength(e.left, h), t.getLength(e.top, c) ], d = f[0], p = f[1];
                        t.drawImage(i, r, s + d, a + p, l, u);
                    }
                }), {
                    x: s + g,
                    y: a + u,
                    w: h - g - v,
                    h: c - u - p
                };
            }, {
                x: 0,
                y: 0,
                w: this.boxWidth,
                h: this.boxHeight
            });
        }, e.prototype.draw = function() {
            var t, e = this, i = this, n = i.config, r = i.ctx;
            i._defaultConfig, i._defaultStyle, null === (t = n.beforeDraw) || void 0 === t || t.call(this, r), 
            r.clearRect(0, 0, this.boxWidth, this.boxHeight);
            var o = this.drawBlocks(), s = o.x, a = o.y, h = o.w, c = o.h;
            if (this._offscreenCanvas) {
                var l = this, u = l.cellWidth, f = l.cellHeight, d = l.cellAndSpacing, p = l.widthAndSpacing, g = l.heightAndSpacing;
                this.slots.forEach(function(t, i) {
                    var n = d * t.order.length, o = e.displacement(-(c - g) / 2, -(h - p) / 2), l = e.scroll[i] + o;
                    l < 0 && (l = l % n + n), l > n && (l %= n);
                    var v = e.displacement([ u * i, l, u, c ], [ l, f * i, h, f ]), m = v[0], w = v[1], y = v[2], b = v[3], S = e.displacement([ s + p * i, a, u, c ], [ s, a + g * i, h, f ]), C = S[0], z = S[1], x = S[2], k = S[3];
                    e.drawImage(r, e._offscreenCanvas, m, w, y, b, C, z, x, k);
                });
            }
        }, e.prototype.carveOnGunwaleOfAMovingBoat = function() {
            var t = this, e = this, i = e._defaultConfig, n = e.prizeFlag, r = e.cellAndSpacing;
            this.endTime = Date.now(), this.slots.forEach(function(e, o) {
                var s = e.order;
                if (s.length) for (var a = e.speed || i.speed, h = e.direction || i.direction, c = s.findIndex(function(t) {
                    return t === n[o];
                }), l = r * s.length, u = t.stopScroll[o] = t.scroll[o], f = 0; ++f; ) {
                    var d = r * c + l * f * h - u, p = T(t.FPS, u, d, i.decelerationTime) - u;
                    if (Math.abs(p) > a) {
                        t.endScroll[o] = d;
                        break;
                    }
                }
            });
        }, e.prototype.play = function() {
            var t, e;
            0 === this.step && (this.startTime = Date.now(), this.prizeFlag = void 0, this.step = 1, 
            null === (e = (t = this.config).afterStart) || void 0 === e || e.call(t), this.run());
        }, e.prototype.stop = function(t) {
            var e;
            if (0 !== this.step && 3 !== this.step) {
                if ("number" == typeof t) this.prizeFlag = new Array(this.slots.length).fill(t); else {
                    if (!c(t, "array")) return this.stop(-1), console.error("stop() 无法识别的参数类型 " + typeof t);
                    if (t.length !== this.slots.length) return this.stop(-1), console.error("stop([" + t + "]) 参数长度的不正确");
                    this.prizeFlag = t;
                }
                (null === (e = this.prizeFlag) || void 0 === e ? void 0 : e.includes(-1)) ? (this.prizeFlag = [], 
                this.step = 0) : this.step = 2;
            }
        }, e.prototype.run = function(t) {
            var e, i, n = this;
            void 0 === t && (t = 0);
            var r = this, o = r.rAF, s = r.step, a = r.prizeFlag, h = r._defaultConfig, c = r.cellAndSpacing, l = r.slots, u = h.accelerationTime, f = h.decelerationTime;
            if (0 !== this.step || (null == a ? void 0 : a.length) !== l.length) {
                if (void 0 === a || a.length) {
                    3 !== this.step || this.endScroll.length || this.carveOnGunwaleOfAMovingBoat();
                    var d = Date.now() - this.startTime, p = Date.now() - this.endTime;
                    l.forEach(function(e, i) {
                        var r = e.order;
                        if (r && r.length) {
                            var o = c * r.length, g = Math.abs(e.speed || h.speed), v = e.direction || h.direction, m = 0, w = n.scroll[i];
                            if (1 === s || d < u) {
                                n.FPS = d / t;
                                var y = L(d, 0, g, u);
                                y === g && (n.step = 2), m = (w + y * v) % o;
                            } else if (2 === s) m = (w + g * v) % o, (null == a ? void 0 : a.length) === l.length && (n.step = 3, 
                            n.stopScroll = [], n.endScroll = []); else if (3 === s && p) {
                                var b = n.stopScroll[i], S = n.endScroll[i];
                                m = T(p, b, S, f), p >= f && (n.step = 0);
                            }
                            n.scroll[i] = m;
                        }
                    }), this.draw(), o(this.run.bind(this, t + 1));
                }
            } else {
                for (var g = a[0], v = 0; v < l.length; v++) {
                    var m = l[v], w = a[v];
                    if (!(null === (e = m.order) || void 0 === e ? void 0 : e.includes(w)) || g !== w) {
                        g = -1;
                        break;
                    }
                }
                null === (i = this.endCallback) || void 0 === i || i.call(this, this.prizes.find(function(t, e) {
                    return e === g;
                }) || void 0);
            }
        }, e.prototype.displacement = function(t, e) {
            return "horizontal" === this._defaultConfig.mode ? e : t;
        }, e.prototype.displacementWidthOrHeight = function() {
            var t = this._defaultConfig.mode, e = this.slots.length, i = this._defaultConfig, n = i.colSpacing, r = i.rowSpacing, o = this.prizeArea || this.drawBlocks();
            o.x, o.y;
            var s, a, h = o.w, c = o.h, l = 0, u = 0;
            return "horizontal" === t ? (u = this.cellHeight = (c - r * (e - 1)) / e, l = this.cellWidth = u) : (l = this.cellWidth = (h - n * (e - 1)) / e, 
            u = this.cellHeight = l), s = this.widthAndSpacing = this.cellWidth + n, a = this.heightAndSpacing = this.cellHeight + r, 
            this.cellAndSpacing = "horizontal" === t ? s : a, {
                cellWidth: l,
                cellHeight: u,
                widthAndSpacing: s,
                heightAndSpacing: a
            };
        }, e;
    }(I);
    i.LuckyGrid = E, i.LuckyWheel = W, i.SlotMachine = O, i.cutRound = function(t, e) {
        var i = document.createElement("canvas"), n = i.getContext("2d"), r = t.width, o = t.height;
        return i.width = r, i.height = o, A(n, 0, 0, r, o, e), n.clip(), n.drawImage(t, 0, 0, r, o), 
        i;
    }, i.opacity = function(t, e) {
        var i = document.createElement("canvas"), n = i.getContext("2d"), r = t.width, o = t.height;
        if (i.width = r, i.height = o, "string" == typeof n.filter) n.filter = "opacity(" + 100 * e + "%)", 
        n.drawImage(t, 0, 0, r, o); else {
            n.drawImage(t, 0, 0, r, o);
            for (var s = n.getImageData(0, 0, r, o), a = s.data, h = a.length, c = 0; c < h; c += 4) {
                var l = a[c + 3];
                0 !== l && (a[c + 3] = l * e);
            }
            n.putImageData(s, 0, 0);
        }
        return i;
    };
}, function(t) {
    return e({}[t], t);
}), e(1684372290546));